1. Field of the Invention
The present invention relates to a computer system, and deals more particularly with a method, apparatus, and computer program product for optimizing recognition of data being sent to a workstation from a legacy host application.
2. Description of the Related Art
One of the challenges facing information services (xe2x80x9cISxe2x80x9d) professionals today is the difficulty of bridging legacy mainframe host data to modem user interfaces. Most legacy host applications present their data in text-based user interfaces designed for use on specific, obsolete character-based terminals. The legacy applications were written with this character-based terminal presentation space as the only interface format in which the host data output is created, and in which host data input is expected. xe2x80x9cPresentation spacexe2x80x9d is a term used abstractly to refer to the collection of information that together comprises the information to be displayed on a user interface screen, as well as the control data that conveys how and where that information is to be represented. This collection of information is stored in an area of computer storage and/or memory.
A typical character-based terminal is the IBM Model 327x. (IBM is a registered trademark of the International Business Machines Corporation.) This terminal model was designed to display information in a matrix of characters, where the matrix typically consisted of 24 rows each having 80 columns. When programs were written expecting this display format, programmers would specify placement of information on the screen using specific row and column locations. Information formatted for this display is sent as a xe2x80x9cdata streamxe2x80x9d to the mechanism in the display hardware that is responsible for actually displaying the screen contents. The phrase xe2x80x9cdata streamxe2x80x9d refers to the fact that the data is sent as a linear string, or stream, of characters. This stream of characters contains both the actual textual information to be displayed on the screen, as well as information specifying where and how the text is to be displayed. xe2x80x9cWherexe2x80x9d consists of the row and column where the text is to begin, and xe2x80x9chowxe2x80x9d consists of a limited number of presentation attributes such as what color (typically either green or white) to use when displaying that text. While the Model 327x is a specific type of IBM display hardware, data formatted for any display having similar characteristics became a de facto standard format referred to as a xe2x80x9c3270 data streamxe2x80x9d. Similarly, the IBM Model 525x is another type of character-based terminal. This terminal displays data in a slightly different manner from the IBM 327x, and consequently uses a different data stream format. The xe2x80x9c5250 data streamxe2x80x9d also became a de facto standard format for displays having similar characteristics. A third type of data stream format commonly used by legacy host applications is referred to simply as an xe2x80x9cASCII data streamxe2x80x9d. While an ASCII data stream is not formatted for a specific model of display screen, a data stream in this format has certain predefined characteristics (for example, the manner in which a control character indicates the line spacing to be used).
The displays used with modern computer workstations (including personal computers, network computers, and other types of computers) support graphics and video, in addition to text characters. These displays do not use a character-based row and column matrix approach to screen layout. Instead, the programmer has access to thousands of tiny display elements, allowing the various types of information to be placed virtually anywhere on the display screen.
When the modem computer workstation is used to access a legacy host application running on a mainframe, the output data created by that host application is often still formatted as one of the character-based data streams. The workstation may have access to the host application and the presentation space it uses through mainframe emulator software. An example of mainframe emulator software is the Personal Communications product from IBM. Emulator software runs on the workstation. This software provides facilities to establish a telecommunications connection between the workstation and the host computer, to invoke execution of a software application stored on that host, and to transfer information between the host and the workstation as the application runs. When a legacy application is accessed using an emulator, it appears to the host as if the host was interacting with a so-called xe2x80x9cdumb terminalxe2x80x9d (such as a Model 3278), instead of an intelligent workstation. The emulator takes care of reformatting the character-based data sent by the legacy application (using the presentation space for transferring data), for display on a modem display screen.
The computer information industry has begun moving away from using mainframe emulators as the primary user interface to the host applications. When an emulator is no longer used, either the legacy host application must be rewritten so that it creates output in a format recognized by modem displays or the emulator""s complicated interface logic for translating between the character-based data stream and the modem workstation display screen layout must be performed by some other service running on the workstation. Rewriting the legacy applications is typically not a viable approach, and thus many IS professionals have chosen an alternative solution. In this alternative solution, the user interface facility of a modern application program accepts the existing host presentation space format when retrieving data from the host application, but does not show the data to the user in this format. The new user interface facility xe2x80x9cscrapesxe2x80x9d (that is, extracts) data from the host presentation space, and presents it to the user in a form that is appropriate for the display screen device used with the computer system. By convention, this form tends to be a graphical user interface where information is presented in a window-based layout. The user interacts with the application using this graphical user interface. When data needs to be returned to the application computer, for example in response to the user""s input, the user interface facility converts this information automatically into a format that is recognized by the host application.
While a screen scraping approach avoids rewriting the legacy host application, it presents a new problem. Presentation spaces appear asynchronously in the data stream sent from the host application, so using the presentation space format as the expected format for user interface data becomes unpredictable. Whether it is due to network traffic, host application response time, etc., there is no set time when a presentation space will begin arriving from the host application, and no specific period of time in which the entire screen contents will be transmitted. U.S. Pat. No. 6,182,276, which is titled xe2x80x9cHost Application Presentation Space Recognition Producing Asynchronous Eventsxe2x80x9d, defines a technique for automating host presentation space interaction. This patent is referred to hereinafter as the related invention, and is incorporated herein by reference. According to this related invention, one or more presentation space definitions may be created, where each definition specifies information that will be present in a particular presentation space that may arrive from the legacy application. For each defined presentation space, a target software routine may be identified which embodies knowledge of how the presentation space is formatted and how the information contained in that presentation space is to be presented to the user. The data stream coming from the host is constantly monitored to see if one of the defined presentation spaces appears. When a defined presentation space does appear, the associated target software routine is asynchronously invoked for processing the data contained in that presentation space.
While the related invention defines a useful advancement in the art, it may suffer from inefficient system performance if the number of presentation space definitions is very large. For those companies which have been using legacy host applications extensively for many years, there may be hundreds or even thousands of screens which are sent by legacy applications to user workstation software. When the presentation space definitions according to the related invention take on this order of magnitude, performing a sequential comparison of an incoming data stream to each defined presentation space may expend a considerable amount of processing time for comparisons which ultimately fail. This may significantly increase processing time, and may be an inefficient use of computing resources.
Accordingly, what is needed is an improved technique for recognizing asynchronously-appearing presentation spaces (and initiating processing thereof) in data streams generated by legacy host applications.
An object of the present invention is to provide a technique for optimizing recognition of presentation space data generated by a legacy host application.
Another object of the present invention is to provide this technique by prioritizing the matching process which is used.
A further object of the present invention is to use prioritization pools for optimizing the matching process.
Yet another object of the present invention to use a time of day heuristic for influencing prioritization in the matching process.
Other objects and advantages of the present invention will be set forth in part in the description and in the drawings which follow and, in part, will be obvious from the description or may be learned by practice of the invention.
To achieve the foregoing objects, and in accordance with the purpose of the invention as broadly described herein, the present invention provides a method, system, and computer program product for optimizing recognition of presentation space data generated by a legacy host application. This technique comprises: organizing a plurality of presentation space definitions into a plurality of pools; monitoring at least one data stream for arrival of presentation space data; comparing an arrived presentation space to the plurality of presentation space definitions in the plurality of pools, this comparison using a prioritized order of the pools; and notifying a target software routine to process the arrived presentation space upon detecting a match by the comparison.
In one embodiment, each of the pools corresponds to a particular time of day period. The comparison then further comprises: determining a current time of day; determining a selected pool corresponding to the determined current time of day; and using the selected pool as a highest priority in the prioritized order. This embodiment may further comprise: using a different pool as a next highest priority in the prioritized order; and adding a matched presentation space definition to this different pool upon detecting the match using this different pool. In addition, this embodiment may further comprise persisting the plurality of pools to persistent storage, thereby reflecting operation of the organizing and the adding.
In another embodiment, each of the pools corresponds to a priority attribute value. The comparison then further comprises: determining a current highest priority attribute value; determining a selected pool corresponding to this current highest priority attribute value; using the selected pool as a highest priority in the prioritized order; and iteratively comparing if the match is not detected. The iterative comparison further comprises: determining a next highest priority attribute value; determining the selected pool corresponding to this next highest priority attribute value; and repeating the use of the selected pool as the highest priority and the iteratively comparing until the match is detected or until no more presentation space definitions remain for use by the comparison. This embodiment may further comprise promoting a matched presentation space definition to a higher priority pool upon detecting the match in a pool which is not a highest priority pool. The plurality of pools may be persisted to persistent storage, thereby reflecting the organizing and this optional promoting. This embodiment may also further comprise selectively demoting presentation space definitions. This selective demotion further comprises: defining an inactivity timer; remembering a timestamp when each of the plurality of presentation space definitions was last matched during operation of the comparison; comparing each of the remembered time stamps to the inactivity timer; and moving each of the presentation space definitions for which the comparing of the remembered timestamp determines that the inactivity timer has expired, wherein the definition is moved from a first pool to a second pool having a next lower priority than the first pool. In this case, an optional persisting of the plurality of pools to persistent storage thereby reflects operation of the organizing, the promoting, and the selective demoting.
The present invention will now be described with reference to the following drawings, in which like reference numbers denote the same element throughout.